{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import os\n",
    "import glob\n",
    "\n",
    "def sort_file(file):\n",
    "    df=pd.read_csv(file, thousands=',')\n",
    "    #print(df)\n",
    "    df=df.sort_values(\"时间\")\n",
    "    df.to_csv(file,index=False)\n",
    "\n",
    "#files=glob.glob(\"raw/*.csv\")+glob.glob(\"adjust/*.csv\")\n",
    "files=glob.glob(\"share_index_future/*.csv\")\n",
    "for file in files:\n",
    "    sort_file(file)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.10.5 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.5"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "c5dec8b0832268acb329dcfb56f17f450030febdfb64dcd05e5a9f38258463ff"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
